import request from '@/utils/request'

//获取列表
export function fetchList(query) {
  return request({
    url: '/admin',
    method: 'get',
    params: query
  })
}

//新增
export function add(data) {
  return request({
    url: '/admin',
    method: 'post',
    data: data
  })
}

//获取单个用户信息
export function get(id) {
  return request({
    url: '/admin/' + id,
    method: 'get'
  })
}

//提交编辑
export function edit(data) {
  return request({
    url: '/admin/' + data.id,
    method: 'put',
    data: data
  })
}


//删除
export function destroy(id) {
  return request({
    url: '/admin/' + id ,
    method: 'delete'
  });
}
